Repository navigation
fix(plugin-detail): a long text formula on the record page wraps instead of being cut to one line - #34180
Conversation
…ough its field widget's read display, so a long text result wraps The record detail field grid drew formula and summary values with the formula cell, whose text face is the grid's one-line truncated cell. They now read through FormulaField / SummaryField read-only, matched by renderer identity; the grid row keeps the cell. Claude-Session: https://claude.ai/code/session_01ADHkmQvpJUh1pfLHvJEVyU Co-authored-by: Claude <noreply@anthropic.com>
…ing on the record page, with grid, number and host-face controls Claude-Session: https://claude.ai/code/session_01ADHkmQvpJUh1pfLHvJEVyU Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmQvpJUh1pfLHvJEVyU Co-authored-by: Claude <noreply@anthropic.com>
… reads through FormulaField SummaryField's read display draws a fixed text-gray-700 with no dark variant, so routing every roll-up through it would dim numeric roll-ups in dark mode on the record page. A formula alone moves. Claude-Session: https://claude.ai/code/session_01ADHkmQvpJUh1pfLHvJEVyU Co-authored-by: Claude <noreply@anthropic.com>
|
domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf 席位核对Verdict: ACCEPT · head
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43779205122 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf Queue ejection reading · head
|
|
domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf Test UI (10/16) red again on the synced head
|
|
domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf 席位核对Verdict: ACCEPT (re-land) · head
|
Requested by Steve · project thread
Fixes #34148
Clause-②: no — a value that was cut now shows in full; no surface added
Metadata-protocol: none
维护者速读
ui/packages/plugin-detail/src/DetailSection.tsx新增的FormulaCellRenderer分支;测试record-details.textReadWraps-25897.test.tsx末尾两个 describe。pnpm --dir ui exec vitest run packages/plugin-detail/src/renderers/__tests__/record-details.textReadWraps-25897.test.tsx,预期 16 个全绿。What changes
On the record detail field grid, a
formulavalue now reads throughFormulaField's read-only display, the face the record form already draws, instead of the formula cell. The formula cell's text face isTextCellRenderer, the grid's one-line cell (truncate, an ellipsis, the whole value only in a hovertitle), so a long text formula was cut to its first words.This is the third branch of the same move
DetailSectionalready makes fortextarea(TextAreaField, objectui#11577) and for every type the table maps toTextCellRenderer(TextField, objectstack#25897):CellRenderer === FormulaCellRenderer) and theformulatype. A host that registered its ownformulaface keeps it.FormulaFieldreads the value by the same rule as the cell (declaredreturnType, else a JS number is a number and everything else is text). The fields package'sformulaFaces.*tests compare the two faces' text for every return type. So number, money, date and boolean results read the same words as before. Only a text result changes how it lays out: it wraps.whitespace-pre-wrapcopy is added. The widget owns its read display.summary(roll-up) also maps toFormulaCellRendererand is deliberately left on the cell. See Acceptance notes.Premise, measured on
mainat 0d1443d (a 120-character value, DetailSection rendered in happy-dom):resolveCellRendererTypetexttextTextCellRenderer→TextFieldread displaytextareatextareaTextAreaFieldread displayformula,returnType: 'text'formulaFormulaCellRenderer→ text faceTextCellRendererspan.block.max-w-full.truncate, value intitle)formula, noreturnType, string valueformulasummary, string valuesummaryCard ask 2 (a long-text return type for formulas, a spec change) is not needed for the card's acceptance after this change: a text formula now wraps at any width without any new declaration.
Tests
New top-level describes in the existing
record:detailsread-wrap harness,record-details.textReadWraps-25897.test.tsx(no new file;renderBodytakes an optional schema and field list):returnType: 'text'formula and an undeclared formula holding the same string each render exactly the markupFormulaFieldrenders read-only. The drawn node's text is the whole value, it has notitle, and no element between it and the row carriestruncate/whitespace-nowrap/text-ellipsis/line-clamp-1.getCellRenderer('formula')isFormulaCellRenderer, which still drawstruncatewith the whole value as itstitle).returnType: 'number'formula still reads1,234.50on the record page.formulaface is kept on the record page.The change is a renderer choice and a class list, so the viewport-sized jsdom/happy-dom render covers both widths named by the card's acceptance: no layout engine runs, and none is needed to read which element draws the value. A real-browser check was NOT MEASURED (no console stack started in this container). The drawn element is
span.text-sm, the same elementTextField's read display draws for a wrappingtextvalue since objectstack#25897.No existing test was edited apart from adding the parameters to
renderBody. Its existing callers pass nothing and behave as before.Ablation (one leg, then restored)
node scripts/ablation-replace.mjsonDetailSection.tsx: the anchorif (CellRenderer === FormulaCellRenderer && resolvedType === 'formula')was replaced with the same condition prefixed byfalse &&(anchor 1 → 0, blob 425bbac8 → 5dfe6457). The harness file then ran 4 failed | 12 passed (16): the four wrap pins (two formulas × two widths). The controls stayed green. Restore: blob == HEAD (425bbac8) andgit diff HEADis empty. ui vitest resolves@object-ui/*tosrc/, so no build sat between the mutation and the run.Local runs (head 91831e6)
pnpm --filter @object-ui/plugin-detail type-check(tsc --noEmit && tsc -p tsconfig.test.json), afterturbo run build --filter='@object-ui/plugin-detail^...': exit 0.pnpm --dir ui exec vitest run packages/plugin-detail/ apps/console/src/services/approvalRequestsDataSource packages/app-shell/src/views/ObjectDataPage.relationUserFilters-13310.test.tsx packages/plugin-grid/src/__tests__/gridNavigationMembers-8071.test.tsx packages/fields/src/__tests__/formulaFaces: exit 0, Test Files 399 passed | 1 skipped (400), Tests 3666 passed | 18 skipped.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, 38 commands): 38/38 exit 0. Reconciled with--ran.git grepof test files that import plugin-detail / DetailSection / RecordDetail and also nameformulaorsummary. CI's Test UI shards run every package.Acceptance notes
summary(roll-up) text values still truncate on the record page.summarymaps to the sameFormulaCellRenderer, and a roll-up holding a string reads through its one-line text face. It was not moved toSummaryField's read display because that display draws a fixedtext-gray-700with no dark-mode variant. Routing every roll-up through it would dim the common numeric roll-ups in dark mode on the record page. Measured in happy-dom on this branch's first head: a string summary renderedspan.text-sm.font-medium.tabular-nums.text-gray-700. A text roll-up (min/maxover a text child field) was not measured at a public door. Carrier: seatdomain:ui#1. Dedupe words: summary field text-gray-700 dark mode; roll-up text value truncated record page.FormulaField's number and date faces drawspan.text-smwithout the cell'stabular-nums. The digits are unchanged, and only their figure width changes on the record page. Polish only, not filed.Verification
CI check-runs on this PR are the record for the families CI runs; see the os-dev-report on the card.
Generated by Claude Code